import {Button} from 'antd'
// 1.crud 请求参数
export const crudRequest = () => {
    let pager = {
        size: 15,
        current: 1,
        total: 50,
    }
    let request = {
        url: "/getList",
        params: {
            size: 50,
            current: 10
        },
        query: {
            name: "张三"
        }
    }
    return {
        pager,
        request
    }
}
// 1.crud columns配置
export const crudColumns = (that) => {
    return [
        {
            title: '序号',
            width: 80,
            align: 'center',
            render: (text, record, index) => {
                const {current, pageSize} = that.state.pagination
                return (current - 1) * (pageSize) + index + 1
            },

        },
        {
            title: '姓名',
            dataIndex: 'name',
            key: 'name',
            render: (text) => <a>{text}</a>,
        },
        {
            title: '年龄',
            dataIndex: 'age',
            key: 'age',
        },
        {
            title: "地址",
            dataIndex: "address",
            key: "address"
        },
        {
            title: "生日",
            dataIndex: "birthday",
            key: "birthday"
        },
        {
            title: "描述",
            dataIndex: "describe",
            key: "describe",
            width: '150',
            ellipsis: true,
        },
        {
            title: "操作",
            key: "edit",
            render: (row) => {
                return (
                    <>
                        <Button type="link" danger onClick={that.removeCell(row)}>
                            删除
                        </Button>
                    </>
                )
            }
        },
    ]
}